/**
 * author: wancheng
 * date: 2018/08/1
 * des: 考勤管理-休假申请
 */
import request from '@/utils/request'

export function getVacationApplyList(data) {
  return request({
    url: '/attendancevacations/findAll',
    method: 'get',
    params: data
  })
}
/**
 * 新增
 * @param {*} data
 */
export function addVacationApply(data) {
  return request({
    url: '/attendancevacations/insert',
    method: 'post',
    data: data
  })
}
/**
 * 获取详情页面
 * @param {*} id
 */
export function getDetail(id) {
  return request({
    url: '/attendancevacations/find/' + id,
    method: 'get'
  })
}

/**
 * 更新
 * @param {*} id
 */
export function updateVacation(data) {
  return request({
    url: '/attendancevacations/update',
    method: 'put',
    data: data
  })
}

/**
 *
 * 获取员工的基本信息，用于新增时的数据回显
 */
export function getUserInFo() {
  return request({
    url: '/commonquerys/queryEmplInfoByUserId',
    method: 'get'
  })
}


/**
 *
 * 删除
 */
export function deleteApply(applyId) {
  return request({
    url: '/attendancevacations/delete/' + applyId,
    method: 'delete'
  })
}

/**
 *
 * 退回后修改 updateBack ,giveup
 */
export function updateBack(data) {
  return request({
    url: '/attendancevacations/updateBack',
    method: 'put',
    data: data
  })
}



/**
 *
 * 放弃
 */
export function giveup(data) {
  return request({
    url: '/attendancevacations/giveup',
    method: 'post',
    data: data
  })
}
